#pragma once

#include "../common/BasePclModel.h"
#include "includeBase.h"

class HullPolygonModel : public BasePclModel
{
public:
    HullPolygonModel();

public:
    static HullPolygonModel& get();

public: // IJsonSerializable
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    QJsonObject toJson() const override;

public: // Property
    QString pcdFile() const { return pcdFile_; }
    void setPcdFile(const QString& pcdFile) { pcdFile_ = pcdFile; }

    QString filterFieldName() const { return filterFieldName_; }
    void setFilterFieldName(const QString& filterFieldName) { filterFieldName_ = filterFieldName; }

    float filterLimitsMin() const { return filterLimitsMin_; }
    void setFilterLimitsMin(float filterLimitsMin) { filterLimitsMin_ = filterLimitsMin; }

    float filterLimitsMax() const { return filterLimitsMax_; }
    void setFilterLimitsMax(float filterLimitsMax) { filterLimitsMax_ = filterLimitsMax; }

    double segDistanceThreshold() const { return segDistanceThreshold_; }
    void setSegDistanceThreshold(double segDistanceThreshold) { segDistanceThreshold_ = segDistanceThreshold; }

    double chullAlpha() const { return chullAlpha_; }
    void setChullAlpha(double chullAlpha) { chullAlpha_ = chullAlpha; }

private:
    QString pcdFile_ = "<pcl-data>/tutorials/table_scene_mug_stereo_textured.pcd";

    QString filterFieldName_ = "z";
    double filterLimitsMin_ = 0;
    double filterLimitsMax_ = 1.1;

    double segDistanceThreshold_ = 0.01;
    double chullAlpha_ = 0.1;
};
